/*
 * MesaSwing.java
 *
 * Created on 3 de diciembre de 2005, 17:45
 */

package javamus;
import javax.swing.JOptionPane;


/**
 *
 * @author  jose
 */
public class MesaSwing extends javax.swing.JFrame implements Mesa {
    
   public  String descartes = "0000";
   public Marcador m;
    
    /** Creates new form MesaSwing */
    public MesaSwing(Marcador m) {
        initComponents();
        mano1.setVisible(false);
        mano2.setVisible(false);
        mano3.setVisible(true);
        mano4.setVisible(false);
        
        this.m = m;
    }
    
    public String getPizarra(){
        return this.pizarra.getText();
    }
    
    public void cambiarMano(){
        this.pizarra.setText("");
        if(this.mano1.isVisible()){
            this.mano1.setVisible(false);
            this.mano2.setVisible(true);
            this.mano3.setVisible(false);
            this.mano4.setVisible(false);
            return;
        }
        if(this.mano2.isVisible()){
            this.mano1.setVisible(false);
            this.mano2.setVisible(false);
            this.mano3.setVisible(true);
            this.mano4.setVisible(false);
            return;
        }
        if(this.mano3.isVisible()){
            this.mano1.setVisible(false);
            this.mano2.setVisible(false);
            this.mano3.setVisible(false);
            this.mano4.setVisible(true);
            return;
        }
        if(this.mano4.isVisible()){
            this.mano1.setVisible(true);
            this.mano2.setVisible(false);
            this.mano3.setVisible(false);
            this.mano4.setVisible(false);
            return;
        }
    }
    public void ocultarCartas(){
        this.jButtonE1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png")));
        this.jButtonE2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png")));     
        this.jButtonE3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png")));
        this.jButtonE4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png")));
        this.jButtonO1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png")));
        this.jButtonO2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png")));     
        this.jButtonO3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png")));
        this.jButtonO4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png")));
        this.carta1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png")));
        this.carta2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png")));     
        this.carta3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png")));
        this.carta4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png")));
        this.jCartaN1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png")));
        this.jCartaN2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png")));     
        this.jCartaN3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png")));
        this.jCartaN4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png")));
    
    }
    
    
    public void mostrarCartas(Player j){
        this.carta1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/"+j.valorCarta1())));
        this.carta2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/"+j.valorCarta2())));     
        this.carta3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/"+j.valorCarta3())));
        this.carta4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/"+j.valorCarta4())));
    }
    public void MostrarCartasN(Player j){
        this.jCartaN1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/"+j.valorCarta1())));
        this.jCartaN2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/"+j.valorCarta2())));     
        this.jCartaN3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/"+j.valorCarta3())));
        this.jCartaN4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/"+j.valorCarta4())));
    
    }
    
    public void MostrarCartasE(Player j){
        this.jButtonE1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/"+j.valorCarta1())));
        this.jButtonE2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/"+j.valorCarta2())));     
        this.jButtonE3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/"+j.valorCarta3())));
        this.jButtonE4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/"+j.valorCarta4())));
    
    }

    
    public void MostrarCartasO(Player j){
        this.jButtonO1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/"+j.valorCarta1())));
        this.jButtonO2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/"+j.valorCarta2())));     
        this.jButtonO3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/"+j.valorCarta3())));
        this.jButtonO4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/"+j.valorCarta4())));
    
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel3 = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        jscroll = new javax.swing.JScrollPane();
        pizarra = new javax.swing.JTextArea();
        panelPuntos = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jPuntos1 = new javax.swing.JLabel();
        jPuntos2 = new javax.swing.JLabel();
        jJuego1 = new javax.swing.JLabel();
        jJuego2 = new javax.swing.JLabel();
        mano5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jPanel6 = new javax.swing.JPanel();
        carta1 = new javax.swing.JLabel();
        carta3 = new javax.swing.JLabel();
        carta2 = new javax.swing.JLabel();
        mano1 = new javax.swing.JLabel();
        carta4 = new javax.swing.JLabel();
        panelIzquierdo = new javax.swing.JPanel();
        jButtonO1 = new javax.swing.JLabel();
        jButtonO2 = new javax.swing.JLabel();
        jButtonO4 = new javax.swing.JLabel();
        jButtonO3 = new javax.swing.JLabel();
        mano4 = new javax.swing.JLabel();
        panelArriba = new javax.swing.JPanel();
        mano3 = new javax.swing.JLabel();
        jCartaN2 = new javax.swing.JLabel();
        jCartaN3 = new javax.swing.JLabel();
        jCartaN1 = new javax.swing.JLabel();
        jCartaN4 = new javax.swing.JLabel();
        mano2 = new javax.swing.JLabel();
        jButtonE2 = new javax.swing.JLabel();
        jButtonE1 = new javax.swing.JLabel();
        jButtonE3 = new javax.swing.JLabel();
        jButtonE4 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("javaMus");
        setBackground(new java.awt.Color(77, 126, 72));
        setName("javaMus"); // NOI18N
        setResizable(false);

        org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 286, Short.MAX_VALUE)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 117, Short.MAX_VALUE)
        );

        jPanel4.setBackground(new java.awt.Color(83, 152, 70));

        pizarra.setColumns(20);
        pizarra.setEditable(false);
        pizarra.setRows(5);
        jscroll.setViewportView(pizarra);

        panelPuntos.setBackground(new java.awt.Color(83, 152, 72));

        jLabel1.setText("Equipo 1");

        jLabel2.setText("Equipo 2");

        jLabel3.setText("Puntos");

        jLabel4.setText("Juegos");

        jPuntos1.setText("0");

        jPuntos2.setText("0");

        jJuego1.setText("0");

        jJuego2.setText("0");

        org.jdesktop.layout.GroupLayout panelPuntosLayout = new org.jdesktop.layout.GroupLayout(panelPuntos);
        panelPuntos.setLayout(panelPuntosLayout);
        panelPuntosLayout.setHorizontalGroup(
            panelPuntosLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(panelPuntosLayout.createSequentialGroup()
                .add(panelPuntosLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel2)
                    .add(jLabel1))
                .add(25, 25, 25)
                .add(panelPuntosLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel3)
                    .add(jPuntos1)
                    .add(jPuntos2))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(panelPuntosLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jJuego2)
                    .add(jJuego1)
                    .add(jLabel4))
                .addContainerGap(34, Short.MAX_VALUE))
        );
        panelPuntosLayout.setVerticalGroup(
            panelPuntosLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(panelPuntosLayout.createSequentialGroup()
                .addContainerGap(21, Short.MAX_VALUE)
                .add(panelPuntosLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel4)
                    .add(jLabel3))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(panelPuntosLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jPuntos1)
                    .add(jLabel1)
                    .add(jJuego1))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(panelPuntosLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jPuntos2)
                    .add(jLabel2)
                    .add(jJuego2)))
        );

        mano5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso2.png"))); // NOI18N

        jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso2.png"))); // NOI18N

        jPanel6.setBackground(new java.awt.Color(83, 152, 70));

        carta1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png"))); // NOI18N

        carta3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png"))); // NOI18N

        carta2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png"))); // NOI18N

        mano1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso2.png"))); // NOI18N

        carta4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png"))); // NOI18N

        org.jdesktop.layout.GroupLayout jPanel6Layout = new org.jdesktop.layout.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel6Layout.createSequentialGroup()
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(carta1)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(carta2)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(carta3)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(carta4)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(mano1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 55, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel6Layout.createSequentialGroup()
                .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(carta1)
                    .add(mano1)
                    .add(carta2)
                    .add(carta3)
                    .add(carta4))
                .addContainerGap())
        );

        panelIzquierdo.setBackground(new java.awt.Color(83, 152, 70));

        jButtonO1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png"))); // NOI18N

        jButtonO2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png"))); // NOI18N

        jButtonO4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png"))); // NOI18N

        jButtonO3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png"))); // NOI18N

        mano4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso2.png"))); // NOI18N

        org.jdesktop.layout.GroupLayout panelIzquierdoLayout = new org.jdesktop.layout.GroupLayout(panelIzquierdo);
        panelIzquierdo.setLayout(panelIzquierdoLayout);
        panelIzquierdoLayout.setHorizontalGroup(
            panelIzquierdoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(panelIzquierdoLayout.createSequentialGroup()
                .add(panelIzquierdoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jButtonO1)
                    .add(jButtonO3))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(panelIzquierdoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jButtonO4)
                    .add(jButtonO2))
                .addContainerGap())
            .add(org.jdesktop.layout.GroupLayout.TRAILING, panelIzquierdoLayout.createSequentialGroup()
                .addContainerGap(86, Short.MAX_VALUE)
                .add(mano4)
                .addContainerGap())
        );
        panelIzquierdoLayout.setVerticalGroup(
            panelIzquierdoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(panelIzquierdoLayout.createSequentialGroup()
                .add(panelIzquierdoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jButtonO1)
                    .add(jButtonO2))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(panelIzquierdoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jButtonO4)
                    .add(jButtonO3))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(mano4)
                .add(24, 24, 24))
        );

        panelArriba.setBackground(new java.awt.Color(83, 152, 70));

        mano3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso2.png"))); // NOI18N

        jCartaN2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png"))); // NOI18N

        jCartaN3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png"))); // NOI18N

        jCartaN1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png"))); // NOI18N

        jCartaN4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png"))); // NOI18N

        org.jdesktop.layout.GroupLayout panelArribaLayout = new org.jdesktop.layout.GroupLayout(panelArriba);
        panelArriba.setLayout(panelArribaLayout);
        panelArribaLayout.setHorizontalGroup(
            panelArribaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(panelArribaLayout.createSequentialGroup()
                .add(mano3)
                .add(jCartaN2)
                .add(jCartaN3)
                .add(jCartaN1)
                .add(jCartaN4))
        );
        panelArribaLayout.setVerticalGroup(
            panelArribaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(panelArribaLayout.createSequentialGroup()
                .add(15, 15, 15)
                .add(mano3))
            .add(jCartaN2)
            .add(jCartaN3)
            .add(jCartaN1)
            .add(jCartaN4)
        );

        mano2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso2.png"))); // NOI18N

        jButtonE2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png"))); // NOI18N

        jButtonE1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png"))); // NOI18N

        jButtonE3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png"))); // NOI18N

        jButtonE4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cartas/reverso.png"))); // NOI18N

        org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel4Layout.createSequentialGroup()
                .add(panelIzquierdo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(panelArriba, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE)
                    .add(jscroll)
                    .add(jPanel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel4Layout.createSequentialGroup()
                        .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(mano2)
                            .add(jButtonE2)
                            .add(jButtonE1))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jButtonE3)
                            .add(jButtonE4)))
                    .add(panelPuntos, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(panelArriba, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(panelPuntos, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(28, 28, 28)
                .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel4Layout.createSequentialGroup()
                        .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jscroll, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 284, Short.MAX_VALUE)
                            .add(panelIzquierdo, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 284, Short.MAX_VALUE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))
                    .add(jPanel4Layout.createSequentialGroup()
                        .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(jButtonE3)
                            .add(jPanel4Layout.createSequentialGroup()
                                .add(mano2)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jButtonE2)))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jButtonE1)
                            .add(jButtonE4))
                        .add(30, 30, 30)))
                .add(jPanel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .add(1124, 1124, 1124)
                        .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 700, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .add(jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(18, 18, 18)
                .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(186, 186, 186))
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-711)/2, (screenSize.height-561)/2, 711, 561);
    }// </editor-fold>//GEN-END:initComponents
    
 
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel carta1;
    private javax.swing.JLabel carta2;
    private javax.swing.JLabel carta3;
    private javax.swing.JLabel carta4;
    private javax.swing.JLabel jButtonE1;
    private javax.swing.JLabel jButtonE2;
    private javax.swing.JLabel jButtonE3;
    private javax.swing.JLabel jButtonE4;
    private javax.swing.JLabel jButtonO1;
    private javax.swing.JLabel jButtonO2;
    private javax.swing.JLabel jButtonO3;
    private javax.swing.JLabel jButtonO4;
    private javax.swing.JLabel jCartaN1;
    private javax.swing.JLabel jCartaN2;
    private javax.swing.JLabel jCartaN3;
    private javax.swing.JLabel jCartaN4;
    private javax.swing.JLabel jJuego1;
    private javax.swing.JLabel jJuego2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JLabel jPuntos1;
    private javax.swing.JLabel jPuntos2;
    private javax.swing.JScrollPane jscroll;
    private javax.swing.JLabel mano1;
    private javax.swing.JLabel mano2;
    private javax.swing.JLabel mano3;
    private javax.swing.JLabel mano4;
    private javax.swing.JLabel mano5;
    private javax.swing.JPanel panelArriba;
    private javax.swing.JPanel panelIzquierdo;
    private javax.swing.JPanel panelPuntos;
    private javax.swing.JTextArea pizarra;
    // End of variables declaration//GEN-END:variables
    
    public void escribir(String a){
         try {
    Thread.currentThread().sleep( 800 );      
  } catch( InterruptedException e ) {
    System.out.println( e );
   }
        this.pizarra.setText(this.pizarra.getText()+"\n"+a);
        this.pizarra.setCaretPosition(this.pizarra.getText().length());
    }
  
   /*
    public void asignarDescartes(int a){
        descartes = a;
    }
    */
    
    public boolean preguntarMus(){
        JOptionPane a = new JOptionPane();          
        int b = a.showConfirmDialog(null,"¿Quieres mus?","PREGUNTA",JOptionPane.YES_NO_OPTION);
        if (b==0)
        {            
                return true;
        }else{
                return false;
        }
    }
    
    public void cambiarCartas(){
        DialogoDescartes d = new DialogoDescartes(this,true,this);
        d.show();
    }
    
    public void apostar(Marcador m,JugadorHumano j){
        DialogoApuesta d = new DialogoApuesta(this,true,this,(Player)j);
        d.show();
    }
    

   public void setPuntos1(int p){
        this.jPuntos1.setText(String.valueOf(p));
    }
   public void setPuntos2(int p){
        this.jPuntos2.setText(String.valueOf(p));
    }
   
   public void setJuego1(int p){
        this.jJuego1.setText(String.valueOf(p));
    }
   public void setJuego2(int p){
        this.jJuego2.setText(String.valueOf(p));
    }
}
